package com.muyu.system.mapper;

import java.util.List;

import com.muyu.danmo.domain.DanmoAddresses;
import com.muyu.system.domain.DanmoShoppingSpecification;
import org.apache.ibatis.annotations.Param;

/**
 * 商品规格Mapper接口
 * 
 * @author kunzong
 * @date 2024-12-02
 */
public interface DanmoShoppingSpecificationMapper 
{
    /**
     * 查询商品规格
     * 
     * @param id 商品规格主键
     * @return 商品规格
     */
    public DanmoShoppingSpecification selectDanmoShoppingSpecificationById(Long id);

    /**
     * 查询商品规格列表
     * 
     * @param danmoShoppingSpecification 商品规格
     * @return 商品规格集合
     */
    public List<DanmoShoppingSpecification> selectDanmoShoppingSpecificationList(DanmoShoppingSpecification danmoShoppingSpecification);

    /**
     * 新增商品规格
     * 
     * @param danmoShoppingSpecification 商品规格
     * @return 结果
     */
    public int insertDanmoShoppingSpecification(DanmoShoppingSpecification danmoShoppingSpecification);

    /**
     * 修改商品规格
     * 
     * @param danmoShoppingSpecification 商品规格
     * @return 结果
     */
    public int updateDanmoShoppingSpecification(DanmoShoppingSpecification danmoShoppingSpecification);

    /**
     * 删除商品规格
     * 
     * @param id 商品规格主键
     * @return 结果
     */
    public int deleteDanmoShoppingSpecificationById(Long id);

    /**
     * 批量删除商品规格
     * 
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteDanmoShoppingSpecificationByIds(Long[] ids);

    /**
     * 根据商品规格id查询商品规格
     * @param shoppingSkuId
     * @return
     */
    DanmoShoppingSpecification findById(@Param("shoppingSkuId") Long shoppingSkuId);

    /**
     * 查询默认地址
     * @param userId
     * @return
     */
    DanmoAddresses selectDanmoDefaultAddress(@Param("userId") Long userId);

    /**
     * 查询该用户的第一个地址
     * @param userId
     * @return
     */
    DanmoAddresses selectDanmoDefaultAddressFirst(@Param("userId") Long userId);

    /**
     * 根据地址id查询地址
     * @param addressId
     * @param userId
     */
    DanmoAddresses selectDanmoAddressByAddressIdAndUserId(@Param("addressId") Long addressId, @Param("userId") Long userId);

    /**
     * 根据商品id和商品规格id查询商品规格
     * @param productId
     * @param productSpecifications
     * @return
     */
    DanmoShoppingSpecification selectDanmoShoppingSpecificationByIdAndProductSpecifications(@Param("productId") Long productId, @Param("productSpecifications") Long productSpecifications);
}
